package ppp.hhh.the.filter;

import jakarta.servlet.Filter;
import jakarta.servlet.annotation.WebFilter;

@WebFilter(filterName = "myFilter",urlPatterns = "/*")
public class MyFilter implements Filter {
    @Override
    public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException {
        System.out.println("MyFilter init");
    }
    @Override
    public void destroy() {
        System.out.println("MyFilter destroy");
    }
    @Override
    public void doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, java.io.IOException {
        System.out.println("MyFilter doFilter");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
